package routers

import (
	"MoSkeleton/framework/core"
	"MoSkeleton/framework/core/config/properties_gin"
	"MoSkeleton/web/routers/external_type"
	"MoSkeleton/web/routers/internal"
)

type RouterInitializer struct {
	ginProperty *properties_gin.GinProperty
}

func NewRouterInitializer(ginProperty *properties_gin.GinProperty) core.DoInitSystem {
	r := new(RouterInitializer)
	r.ginProperty = ginProperty
	return r
}

func (r *RouterInitializer) OnInitSystem() error {
	internal.NewRouterMakeup(r.ginProperty)
	return nil
}

func init() {
	external_type.NewInitRouter = NewRouterInitializer
}
